<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>民宿管理系统</title>
    <link rel="stylesheet" href="/static/common/layui/css/layui.css">
    <link rel="stylesheet" href="/static/admin/css/login.css">
    <script src="/static/common/layui/layui.js"></script>
</head>
<body id="login">
<div class="login">
    <h2><strong><font face="仿宋">民宿管理系统</font></strong></h2>
    <form class="layui-form" method="post" action="/admins">
        <%--设置隐藏域--%>
        <input type="hidden" name="action" value="login">

        <div class="layui-form-item">
            <input type="text" name="username" id="username" value="${username}" placeholder="用户名"
                   class="layui-input" required>
            <i class="layui-icon input-icon">&#xe66f;</i>
        </div>
        <div class="layui-form-item">
            <input type="password" name="password" id="password" value="${password}" placeholder="密码"
                   class="layui-input" required>
            <i class="layui-icon input-icon">&#xe673;</i>
        </div>
        <div class="layui-form-item">
            <input type="text" name="usercode" placeholder="验证码" value="${usercode}" style="width: 100px"
                   class="layui-input" required>
            <img src="/CodeServlet.do" style="width: 80px;position: absolute;top: 2px; left:115px"
                 onclick="changeCode(this);">
            <i class="layui-icon input-icon">&#xe673;</i>
        </div>
        <div class="layui-form-item">
            <div>
                <span style="color: red">${msg}</span>
            </div>
        </div>
        <div class="layui-form-item">
            <button style="width: 100%;background-color: #36e136" class="layui-btn layui-btn-radius layui-btn-normal" lay-submit lay-filter="login">立即登录</button>
        </div>
        <div class="layui-form-item">
            <button style="width: 100%;" class="layui-btn layui-btn-radius layui-btn-normal" lay-submit lay-filter="register" onclick="window.location.href='/views/register.jsp'">注册账号</button>
        </div>
        <br>
    </form>
</div>
</body>
<script>
    function changeCode(img) {
        img.src = "/CodeServlet.do?time=" + new Date();
    }
</script>
</html>
